package com.smartscreen.contentmanage.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("class_moment")
public class ClassMoment {
    @TableId(value = "moment_id", type = IdType.ASSIGN_ID)
    private String momentId;
    
    private String classId;
    
    private String authorId;
    
    private String authorName;
    
    private String description;
    
    @TableField(typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
    private List<MediaItem> media;
    
    private String status; // pending, approved, rejected
    
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
    private LocalDateTime createdAt;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss'Z'")
    private LocalDateTime updatedAt;
    
    @Data
    public static class MediaItem {
        private String type; // image, video
        private String url;
    }
}